package com.zzedu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzedu.domain.ZzClassesBookUnlock;
import com.zzedu.dto.ZzClassesBookUnlockDTO;
import com.zzedu.mapper.ZzClassesBookUnlockMapper;
import com.zzedu.service.IZzClassesBookUnlockService;
import org.springframework.stereotype.Service;
/**
 * 班级解锁记录Service业务层处理
 * 
 * @author Mr.Wang
 * @date 2025-08-30
 */
@Service
public class ZzClassesBookUnlockServiceImpl extends ServiceImpl<ZzClassesBookUnlockMapper,ZzClassesBookUnlock> implements IZzClassesBookUnlockService
{

    @Override
    public LambdaQueryWrapper<ZzClassesBookUnlock> buildQuery(ZzClassesBookUnlockDTO zzClassesBookUnlock) {
        LambdaQueryWrapper<ZzClassesBookUnlock> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.eq(null!=zzClassesBookUnlock.getSchoolId(), ZzClassesBookUnlock::getSchoolId, zzClassesBookUnlock.getSchoolId());
        lambdaQueryWrapper.eq(null!=zzClassesBookUnlock.getUnitId(), ZzClassesBookUnlock::getUnitId, zzClassesBookUnlock.getUnitId());
        lambdaQueryWrapper.eq(null!=zzClassesBookUnlock.getClzzId(), ZzClassesBookUnlock::getClzzId, zzClassesBookUnlock.getClzzId());
        lambdaQueryWrapper.eq(null!=zzClassesBookUnlock.getBookId(), ZzClassesBookUnlock::getBookId, zzClassesBookUnlock.getBookId());
        lambdaQueryWrapper.eq(null!=zzClassesBookUnlock.getUnLockDate(), ZzClassesBookUnlock::getUnLockDate, zzClassesBookUnlock.getUnLockDate());
        lambdaQueryWrapper.eq(null!=zzClassesBookUnlock.getGmtCreate(), ZzClassesBookUnlock::getGmtCreate, zzClassesBookUnlock.getGmtCreate());
        lambdaQueryWrapper.eq(null!=zzClassesBookUnlock.getGmtModify(), ZzClassesBookUnlock::getGmtModify, zzClassesBookUnlock.getGmtModify());
        lambdaQueryWrapper.eq(null!=zzClassesBookUnlock.getDeleted(), ZzClassesBookUnlock::getDeleted, zzClassesBookUnlock.getDeleted());

        lambdaQueryWrapper.orderByDesc(ZzClassesBookUnlock::getId);
        return lambdaQueryWrapper;
    }
}